import request from '@/utils/request'

export default {
  deleteCarousel(params) {
    return request({
      url: '/carousel/deleteCarousel',
      method: 'post',
      params
    })
  },
  insertCarousel(params) {
    return request({
      url: '/carousel/insertCarousel',
      method: 'post',
      params
    })
  },
  findAllOrders() {
    return request({
      url: '/order/findAllOrders',
      method: 'post',
    })
  },
  findOrdersById(params) {
    return request({
      url: '/order/findOrdersById',
      method: 'post',
      params
    })
  },
  findAllCarousel() {
    return request({
      url: '/carousel/findAllCarousel',
      method: 'post',
    })
  },
  findAllUsers() {
    return request({
      url: '/user/findAllUsers',
      method: 'post',
    })
  },
  updateUserState(params) {
    return request({
      url: '/user/updateUserState',
      method: 'post',
      params
    })
  },
  resetUser(params) {
    return request({
      url: '/user/resetUser',
      method: 'post',
      params
    })
  },
  deleteUser(params) {
    return request({
      url: '/user/deleteUser',
      method: 'post',
      params
    })
  },
  deleteProductById(params) {
    return request({
      url: '/product/deleteProductById',
      method: 'post',
      params
    })
  },
  findProductByCategoryId(params) {
    return request({
      url: '/product/findProductByCategoryId',
      method: 'post',
      params
    })
  },
  updateProduct(data) {
    return request({
      url: '/product/updateProduct',
      method: 'post',
      data
    })
  },
  findProductById(params) {
    return request({
      url: '/product/findProductById',
      method: 'post',
      params
    })
  },

  findAllCategory() {
    return request({
      url: '/product/findAllCategory',
      method: 'post',
    })
  },

  insertProduct(data) {
    return request({
      url: '/product/insertProduct',
      method: 'post',
      data
    })
  },

  updateProductPicture(data) {
    return request({
      url: '/product/updateProductPicture',
      method: 'post',
      data: data,
      headers: {
        'Content-Type': 'application/json'
      }
    })
  },

  pictureUpload(params) {
    return request({
      url: "/product/pictureUpload",
      method: "post",
      headers: {
        'Content-Type': 'multipart/form-data'
      },
      withCredentials: false,
      data: params
    })
  },
  imgInfo(params) {
    return request({
      url: '/product/imgInfo',
      method: 'get',
      params
    })
  },

}
